/*
 *The code is written by NaLi, All rights reserved.
 */
package com.nali.dal.statement.function;

import java.util.List;

/**
 * @author gavin 
 * Created on 2011-4-11
 */
public abstract class DoubleArgumentDataHandler<T, V> extends AbstractDataHandler<V> {
	@Override
	public void validate(List<FunctionArgument> arguments) throws FunctionException {
		checkSize(arguments, 2);
	}
	
	protected abstract V handle(T arg1, T arg2) throws FunctionException;

	@SuppressWarnings("unchecked")
	@Override
	public V handle(List<Object> argList) throws FunctionException {
		return handle((T)argList.get(0), (T)argList.get(1));
	}
}

